package corp.edu.amadeus.core.dao.ifc;

import java.io.Serializable;
import java.lang.reflect.Method;
import java.sql.Connection;
import java.util.Collection;
import java.util.List;

import org.springframework.orm.hibernate3.HibernateCallback;

import corp.edu.amadeus.core.business.object.ifc.IPersistable;
import corp.edu.amadeus.core.dao.impl.callback.FindByCriteriaCallback;
import corp.edu.amadeus.core.dao.impl.callback.FindByNamedQueryCallback;
import corp.edu.amadeus.core.dao.impl.callback.FindUniqueByNamedQueryCallback;
import corp.edu.amadeus.core.dao.impl.callback.GenericFindCallback;
import corp.edu.amadeus.core.dao.impl.callback.GenericFindCallbackWithOrder;


public interface IDAOSupport {

	 public Connection connection();


	    public void setFlushMode(int mode);


	    public void flush();


	    public void persist(IPersistable po);


	    public void delete(IPersistable po);


	    public void update(IPersistable po);


	    public void refresh(IPersistable po);

	    public void saveOrUpdate(IPersistable po);

	    /**
	     * Find object by primary key.
	     *
	     * @param pk the pk of the object to find.
	     */
	    public Object findByPK(Class clazz, Serializable pk);
	    public List genericFind(Class po, Method[] methods, Object[] reqResults);

	    public List genericFind(Class po, Method[] methods, Object[] reqResults,
			   String orderProperty, String orderType);

	    public List genericFind(Class po, Method[] methods, Object[] reqResults,
			   String orderProperty, String orderType, int limit);

	    public List findByCriteria(final Class target, final Collection criterion,
		    final Collection projections, String orderProperty, String orderType, int limit);

	    public List findByCriteria(final Class target, final Collection criterion,
		    final Collection projections, int limit);

	    public List paginatedFindByCriteria(final Class target,
	            final Collection criterion, final int first, final int last);
	    public List findByNamedQuery(final String queryName, final Collection params);
	    public Object findUniqueByNamedQuery(final String query, final Collection params);
	    public List findByNamedQuery(final String queryName);

	    public List findByQuery(final String query);
}